package com.eastfair.venueservice.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.venueservice.enumeration.SpaceAcceptanceDealResultEnum;
import com.eastfair.venueservice.enumeration.SpaceAcceptanceFinishStatusEnum;
import com.eastfair.venueservice.enumeration.SpaceAcceptanceCompanyTypeEnum;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 展厅验收记录
 * </p>
 *
 * @author linan
 * @since 2023-01-09
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("vsm_space_acceptance")
@ApiModel(value = "SpaceAcceptance", description = "展厅验收记录")
@AllArgsConstructor
public class SpaceAcceptance extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 场馆综合展会ID
     */
    @ApiModelProperty(value = "场馆综合展会ID")
    @TableField(value = "exhibition_manage_id")
    @Excel(name = "场馆综合展会ID")
    private Long exhibitionManageId;

    /**
     * 验收单号
     */
    @ApiModelProperty(value = "验收单号")
    @Size(max = 255, message = "验收单号长度不能超过255")
    @TableField(value = "accept_no", condition = LIKE)
    @Excel(name = "验收单号")
    private String acceptNo;

    /**
     * 企业类型 #{HOME_COURT:主场;MAIN_TRANSPORT:主运}
     */
    @ApiModelProperty(value = "企业类型 #{HOME_COURT:主场;MAIN_TRANSPORT:主运}")
    @TableField(value = "company_type")
    @Excel(name = "企业类型 #{HOME_COURT:主场;MAIN_TRANSPORT:主运}", replace = {"主场_HOME_COURT", "主运_MAIN_TRANSPORT",  "_null"})
    private SpaceAcceptanceCompanyTypeEnum companyType;

    /**
     * 企业id
     */
    @ApiModelProperty(value = "企业id")
    @TableField(value = "company_id")
    @Excel(name = "企业id")
    private Long companyId;

    /**
     * 企业名称
     */
    @ApiModelProperty(value = "企业名称")
    @Size(max = 255, message = "企业名称长度不能超过255")
    @TableField(value = "company_name", condition = LIKE)
    @Excel(name = "企业名称")
    private String companyName;

    /**
     * 申请人姓名
     */
    @ApiModelProperty(value = "申请人姓名")
    @Size(max = 255, message = "申请人姓名长度不能超过255")
    @TableField(value = "application_name", condition = LIKE)
    @Excel(name = "申请人姓名")
    private String applicationName;

    /**
     * 联系方式
     */
    @ApiModelProperty(value = "联系方式")
    @Size(max = 255, message = "联系方式长度不能超过255")
    @TableField(value = "phone", condition = LIKE)
    @Excel(name = "联系方式")
    private String phone;

    /**
     * 验收部门id
     */
    @ApiModelProperty(value = "验收部门id")
    @TableField(value = "org_id")
    @Excel(name = "验收部门id")
    private Long orgId;

    /**
     * 验收部门
     */
    @ApiModelProperty(value = "验收部门")
    @Size(max = 255, message = "验收部门长度不能超过255")
    @TableField(value = "org_name", condition = LIKE)
    @Excel(name = "验收部门")
    private String orgName;

    /**
     * 完成状态 #{NEED_DEAL:待处理;HAS_DISPATCH:已派单;FINISHED:已完成;ACCEPTED:已验收;}
     */
    @ApiModelProperty(value = "完成状态 #{NEED_DEAL:待处理;HAS_DISPATCH:已派单;FINISHED:已完成;ACCEPTED:已验收;}")
    @TableField(value = "finish_status")
    @Excel(name = "完成状态 #{NEED_DEAL:待处理;HAS_DISPATCH:已派单;FINISHED:已完成;ACCEPTED:已验收;}", replace = {"待处理_NEED_DEAL", "已派单_HAS_DISPATCH", "已完成_FINISHED", "已验收_ACCEPTED",  "_null"})
    private SpaceAcceptanceFinishStatusEnum finishStatus;

    /**
     * 处理结果 #{SITE_ACCEPTANCE_IS_QUALIFIED:场地验收合格;UNQUALIFIED_SITE_DAMAGE:场地损坏不合格}
     */
    @ApiModelProperty(value = "处理结果 #{SITE_ACCEPTANCE_IS_QUALIFIED:场地验收合格;UNQUALIFIED_SITE_DAMAGE:场地损坏不合格}")
    @TableField(value = "deal_result")
    @Excel(name = "处理结果 #{SITE_ACCEPTANCE_IS_QUALIFIED:场地验收合格;UNQUALIFIED_SITE_DAMAGE:场地损坏不合格}", replace = {"场地验收合格_SITE_ACCEPTANCE_IS_QUALIFIED", "场地损坏不合格_UNQUALIFIED_SITE_DAMAGE",  "_null"})
    private SpaceAcceptanceDealResultEnum dealResult;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Size(max = 255, message = "备注长度不能超过255")
    @TableField(value = "remark", condition = LIKE)
    @Excel(name = "备注")
    private String remark;

    /**
     * 附件URL
     */
    @ApiModelProperty(value = "附件URL")
    @Size(max = 1024, message = "附件URL长度不能超过1024")
    @TableField(value = "file_url", condition = LIKE)
    @Excel(name = "附件URL")
    private String fileUrl;

    /**
     * 展馆编码
     */
    @ApiModelProperty(value = "展馆编码")
    @Size(max = 64, message = "展馆编码长度不能超过64")
    @TableField(value = "space_code", condition = LIKE)
    @Excel(name = "展馆编码")
    private String spaceCode;

    /**
     * 展馆号
     */
    @ApiModelProperty(value = "展馆号")
    @Size(max = 100, message = "展馆号长度不能超过100")
    @TableField(value = "space_name", condition = LIKE)
    @Excel(name = "展馆号")
    private String spaceName;


    @Builder
    public SpaceAcceptance(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId, 
                    Long exhibitionManageId, String acceptNo, SpaceAcceptanceCompanyTypeEnum companyType, Long companyId, String companyName, String applicationName, 
                    String phone, Long orgId, String orgName, SpaceAcceptanceFinishStatusEnum finishStatus, SpaceAcceptanceDealResultEnum dealResult, String remark, 
                    String fileUrl, String spaceCode, String spaceName) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.exhibitionManageId = exhibitionManageId;
        this.acceptNo = acceptNo;
        this.companyType = companyType;
        this.companyId = companyId;
        this.companyName = companyName;
        this.applicationName = applicationName;
        this.phone = phone;
        this.orgId = orgId;
        this.orgName = orgName;
        this.finishStatus = finishStatus;
        this.dealResult = dealResult;
        this.remark = remark;
        this.fileUrl = fileUrl;
        this.spaceCode = spaceCode;
        this.spaceName = spaceName;
    }

}
